<template>
	<view class="main">
		<!-- topBar -->
		<lawBankTopBar :title="title" :backgroundUrl="backgroundUrl"></lawBankTopBar>
		<view class="content">
			<view id="show_content">
				<view class="content_top" v-if="!this.isSearch">
					<!-- 搜索 -->
					<view class="search">
						<u-search placeholder="输入您想了解的内容" :showAction="false" bgColor="#fff" borderColor="#C4C4C4" height="70rpx"
							@blur="goSearch" v-model="keyword" :clearabled="false"></u-search>
					</view>
					<view class="highSearch flex_col" @click="goHighSearch(1)">
						<text>高级</text>
						<text>搜索</text>
					</view>
				</view>

				<!-- 分类 -->
				<view class="sort" v-if="!this.form.keyword && !this.isSearch">
					<view :class="['sort_item', chooseTagId == item.id ? 'sort_item_active' : '']" v-for="item in sortList"
						:key="item.id" @click="chooseTag(item)">{{ item.name }}</view>
				</view>
				<view v-else class="result">为你找到 <text style="color: #FF0000">{{ count }}</text> 个结果</view>
			</view>
			<!-- 列表 -->
			<scroll-view class="content_list" :style="{ height: `calc(100vh - ${this.isSearch1 ? 540 : (isSearch ? 480 : 640)}rpx` }" :scroll-y="true"
				:scroll-top="scrollTop" refresher-enabled="true" :refresher-triggered="isRefreshing" @refresherrefresh="reload"
				@scrolltolower="loadMore">
				<view class="content_item" v-for="(item, index) in lawList" :key="index" @click="toInfo(item.id)">
					<view class="item_top">
						<view class="item_dot"></view>
						<view class="item_title ellipsis2" v-html="hightLightText(item.title, form.keyword)"></view>
					</view>
					<view class="item_bottom">
						<view class="item_dot"></view>
						<view class="item_info">
							<view class="potency">效力注释：{{ item.active_info }}</view>
							<view class="time">发文日期：{{ item.push_date }}</view>
						</view>
					</view>
				</view>
				<uni-load-more :status="loadMoreStatus"></uni-load-more>
			</scroll-view>

		</view>


		<view v-show="showPopup">
			<u-modal :show="showPopup" :showCancelButton="true" title="温馨提示" width="580rpx" @confirm="goPlatform()"
				@cancel="showPopup = false" confirmText="加入会员" :content="tipsMsg"></u-modal>
		</view>
	</view>
</template>

<script type="text/javascript" src="plus-confusion://../lawBank/revenue/index"></script>

<style lang="scss">
.main {
	background: #fff;

	.content {
		width: 100%;
		position: relative;
		z-index: 10;
		margin-top: -32rpx;
		background: #fff;
		border-radius: 40rpx;
		padding: 30rpx;
		box-sizing: border-box;

		.content_top {
			display: flex;
			align-items: center;
			justify-content: space-between;

			.search {
				width: 600rpx !important;
			}

			.highSearch {
				font-size: 24rpx;
				font-weight: 600;
				color: #1C87F3;
				line-height: 28rpx;
			}
		}

		.sort {
			margin-top: 40rpx;
			display: flex;
			flex-wrap: wrap;
			justify-content: space-evenly;

			.sort_item {
				display: inline-block;
				margin-bottom: 17rpx;
				padding: 12rpx 22rpx;
				background: #F6F6F6;
				border-radius: 74rpx;
				font-size: 24rpx;
				color: #333333;
				line-height: 35rpx;
			}

			.sort_item_active {
				background: #1C87F3;
				color: #fff;
			}
		}

		.result {
			margin: 40rpx 0 50rpx 0;
		}

		.content_list {
			margin-top: 40rpx;

			.content_item {
				margin-bottom: 60rpx;

				.item_top,
				.item_bottom {
					display: flex;
					align-items: center;

					.item_dot {
						margin-right: 30rpx;
						width: 16rpx;
						height: 16rpx;
						background: #D7E5FF;
						border-radius: 50%;
					}

					.item_title {
						width: calc(100% - 46rpx);
						font-size: 34rpx;
						font-weight: 600;
						color: #3D3D3D;
						line-height: 40rpx;
					}

				}

				.item_bottom {
					margin-top: 24rpx;

					.item_dot {
						visibility: hidden;
					}

					.item_info {
						width: 100%;
						display: flex;
						align-items: center;
						justify-content: space-between;
						font-size: 24rpx;
						color: #BCBCBC;
						line-height: 28rpx;
					}
				}
			}
		}
	}
}
</style>
